<template>
    <div>
        <button @click="sum++">+</button>sum：{{sum}}
        <br>
        <h1>鼠标的位置x:{{point.x}}, y:{{point.y}}</h1>
    </div>
</template>

<script>
import {ref} from 'vue'
import usePoint from '../hooks/usePoint';
export default {
    name: 'Demo',
    setup(){
        let sum = ref(0)
        let point = usePoint();
        return {
            sum,point
        }
    },
    // beforeCreate() {
    //     console.log('---beforeCreate---')
    // },
    // created() {
    //     console.log('---created---')
    // },
    // beforeMount() {
    //     console.log('---beforeMount---')
    // },
    // mounted() {
    //     console.log('---mounted---')
    // },
    // beforeUpdate(){
    //     console.log('---beforeUpdate---')
    // },
    // updated() {
    //     console.log('---updated---')
    // },
    // beforeUnmount() {
    //     console.log('---beforeUnmount---')
    // },
    // unmounted() {
    //     console.log('---unmounted---')
    // },
}
</script>

<style>
#app {
    font-family: Avenir, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: center;
    color: #2c3e50;
    margin-top: 60px;
}
</style>
